package com.zuqiuzhandui.testing.myhelper.util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yq on 2016-10-12.
 */

public class HashMapProxy<K,V> extends HashMap<K,V> {
    //重写HashMap的所有构造函数---start
    public HashMapProxy(int initialCapacity) {
        super(initialCapacity);
    }

    public HashMapProxy() {
        super();
    }

    public HashMapProxy(Map<? extends K, ? extends V> m) {
        super(m);
    }

    public HashMapProxy(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);
    }
//重写HashMap的所有构造函数---end

    /**
     * 对 HashMap 的 put() 的方法进行封转返回  HashMapProxy 来实现 链式添加
     *
     * @param key
     * @param value
     * @return
     */
    public HashMapProxy putObject(K key, V value) {
        this.put(key, value);
        return this;
    }

}
